﻿using System.IO;

namespace SharpDepend
{
    public enum DriveType
    {
        Logical,
        Special,
        All
    }

    public interface IFileManagerManager
    {
        /// <summary>
        /// Get available drivers.
        /// </summary>
        /// <returns></returns>
        string[] GetDrives(DriveType driveType);

        /// <summary>
        /// Check if a path exist or not.
        /// </summary>
        /// <param name="path">Path to check.</param>
        /// <param name="directory">True if to check directory, otherwise file.</param>
        /// <returns>True if path exist, otherwise false.</returns>
        bool PathExist(string path, bool directory);

        /// <summary>
        /// Create platfomr independent folder.
        /// </summary>
        /// <param name="path">Folder path.</param>
        void CreateFolder(string path);

        /// <summary>
        /// Create platform independent stream file.
        /// </summary>
        /// <param name="path">Path.</param>
        /// <returns>Created stream.</returns>
        Stream CreateFile(string path);

        /// <summary>
        /// Open platform independent stream file.
        /// </summary>
        /// <param name="path">Path.</param>
        /// <returns>Opened stream.</returns>
        Stream OpenFile(string path);

        /// <summary>
        /// List all files from a specific folder.
        /// </summary>
        /// <param name="folderPath">Folder path.</param>
        /// <returns>Array of files.</returns>
        string[] ListFiles(string folderPath);

        /// <summary>
        /// List all folders from a specific folder.
        /// </summary>
        /// <param name="folderPath">Folder path.</param>
        /// <returns>Array of files.</returns>
        string[] ListFolders(string folderPath);

        /// <summary>
        /// Copy a file.
        /// </summary>
        /// <param name="stream">Source file to copy.</param>
        /// <param name="destinationPath">Destination file.</param>
        void CopyFile(Stream stream, string destinationPath);

        /// <summary>
        /// Move a file to another destination.
        /// </summary>
        /// <param name="sourcePath">Source.</param>
        /// <param name="destinationPath">Destination.</param>
        void MoveFile(string sourcePath, string destinationPath);

        /// <summary>
        /// Delete a file from disc.
        /// <para>No undo can be done.</para>
        /// </summary>
        /// <param name="filePath">File path.</param>
        void DeleteFile(string filePath);

        /// <summary>
        /// Delete a folder from disc.
        /// <para>No undo can be done.</para>
        /// </summary>
        /// <param name="folderPath">Folder path.</param>
        void DeleteFolder(string folderPath);
    }
}
